home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Megahits 5
/
Megahits 5 (1994)(GTI - Rhein-Main-Soft)(DE)(Disc 2 of 2)[!].iso
/
archive
/
print
/
virtprinters2.lha
/
screen_printer_source
/
density.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-27
|
1KB
|
43 lines
/***************************************************************************
*
* Density module for Screen_Printer
*/
#include <exec/types.h>
#include <devices/printer.h>
#include <devices/prtbase.h>
void SetDensity(ULONG density_code)
{
extern struct PrinterData *PD;
extern struct PrinterExtendedData *PED;
/* SPECIAL_DENSITY 0 1 2 3 4 5 6 7 */
static int XDPI[8] = {80, 80, 80, 120, 160, 180, 240, 300};
static int YDPI[8] = {68, 68, 80, 120, 136, 180, 240, 300};
/* Set page size to defaults */
PED->ped_MaxColumns = 80; /* 8.0" */
PED->ped_MaxYDots = 100; /* 10.0" */
switch(PD->pd_Preferences.PaperSize) {
case W_TRACTOR:
PED->ped_MaxColumns = 136; /* 13.6" x 10.0" */
break;
case US_LEGAL:
PED->ped_MaxYDots = 140; /* 8.0" x 14.0" */
break;
case CUSTOM:
PED->ped_MaxColumns =
PD->pd_Preferences.PrintMaxWidth;
PED->ped_MaxYDots =
PD->pd_Preferences.PrintMaxHeight;
break;
}
density_code /= SPECIAL_DENSITY1;
PED->ped_MaxXDots =
XDPI[density_code] * PED->ped_MaxColumns / 10;
PED->ped_MaxYDots = YDPI[density_code] * PED->ped_MaxYDots / 10;
PED->ped_XDotsInch = XDPI[density_code];
PED->ped_YDotsInch = YDPI[density_code];
}